// Mock 数据配置
export default {
  // 获取用户信息
  'GET /api/user/info': {
    code: 200,
    message: '成功',
    data: {
      id: 1,
      name: '张三',
      phone: '138****8888',
      avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
      balance: 1288.50,
      points: 520
    }
  },

  // 获取订单列表
  'GET /api/orders': {
    code: 200,
    message: '成功',
    data: {
      list: [
        {
          id: 1,
          orderNo: 'JJ202501280001',
          status: 1, // 1-待服务 2-服务中 3-已完成 4-已取消
          statusText: '待服务',
          serviceType: '深度清洁',
          serviceTime: '2025-01-28 14:00',
          address: '北京市朝阳区xxx小区xxx号楼xxx室',
          amount: 299.00,
          createTime: '2025-01-28 10:30'
        },
        {
          id: 2,
          orderNo: 'JJ202501270002',
          status: 3,
          statusText: '已完成',
          serviceType: '日常保洁',
          serviceTime: '2025-01-27 09:00',
          address: '北京市海淀区xxx大厦xxx室',
          amount: 199.00,
          createTime: '2025-01-27 08:00'
        },
        {
          id: 3,
          orderNo: 'JJ202501260003',
          status: 2,
          statusText: '服务中',
          serviceType: '开荒保洁',
          serviceTime: '2025-01-26 15:30',
          address: '北京市西城区xxx路xxx号',
          amount: 599.00,
          createTime: '2025-01-26 12:00'
        }
      ],
      total: 3,
      page: 1,
      pageSize: 10
    }
  },

  // 获取服务类型列表
  'GET /api/services': {
    code: 200,
    message: '成功',
    data: [
      {
        id: 1,
        name: '日常保洁',
        description: '定期清洁维护，保持家居整洁',
        price: 199.00,
        unit: '次',
        icon: 'https://img.yzcdn.cn/vant/cat.jpeg',
        tags: ['热门', '推荐']
      },
      {
        id: 2,
        name: '深度清洁',
        description: '全面深度清洁，彻底除尘除菌',
        price: 299.00,
        unit: '次',
        icon: 'https://img.yzcdn.cn/vant/cat.jpeg',
        tags: ['专业']
      },
      {
        id: 3,
        name: '开荒保洁',
        description: '新房装修后全面清洁服务',
        price: 599.00,
        unit: '次',
        icon: 'https://img.yzcdn.cn/vant/cat.jpeg',
        tags: ['新房必备']
      },
      {
        id: 4,
        name: '家电清洗',
        description: '专业家电深度清洗服务',
        price: 159.00,
        unit: '台',
        icon: 'https://img.yzcdn.cn/vant/cat.jpeg',
        tags: ['健康']
      }
    ]
  },

  // 创建订单
  'POST /api/orders': {
    code: 200,
    message: '订单创建成功',
    data: {
      orderId: 4,
      orderNo: 'JJ202501280004'
    }
  },

  // 取消订单
  'PUT /api/orders/:id/cancel': {
    code: 200,
    message: '订单取消成功',
    data: null
  },

  // 获取地址列表
  'GET /api/addresses': {
    code: 200,
    message: '成功',
    data: [
      {
        id: 1,
        name: '张三',
        phone: '138****8888',
        province: '北京市',
        city: '北京市',
        district: '朝阳区',
        detail: 'xxx小区xxx号楼xxx室',
        isDefault: true
      },
      {
        id: 2,
        name: '李四',
        phone: '139****9999',
        province: '北京市',
        city: '北京市',
        district: '海淀区',
        detail: 'xxx大厦xxx室',
        isDefault: false
      }
    ]
  },

  // 获取优惠券列表
  'GET /api/coupons': {
    code: 200,
    message: '成功',
    data: [
      {
        id: 1,
        name: '新用户专享',
        description: '首次下单立减50元',
        amount: 50.00,
        minAmount: 200.00,
        status: 1, // 1-可用 2-已使用 3-已过期
        expireTime: '2025-02-28 23:59:59'
      },
      {
        id: 2,
        name: '满减优惠',
        description: '满300减30',
        amount: 30.00,
        minAmount: 300.00,
        status: 1,
        expireTime: '2025-03-31 23:59:59'
      }
    ]
  },

  // 获取消息通知列表
  'GET /api/notifications': {
    code: 200,
    message: '成功',
    data: [
      {
        id: 1,
        title: '订单服务提醒',
        content: '您的订单JJ202501280001将于今日14:00开始服务，请保持电话畅通',
        type: 'order',
        isRead: false,
        createTime: '2025-01-28 13:00'
      },
      {
        id: 2,
        title: '优惠活动',
        content: '新春特惠活动开始啦！全场服务8.8折，快来抢购吧！',
        type: 'promotion',
        isRead: true,
        createTime: '2025-01-27 10:00'
      }
    ]
  },

  // 用户登录
  'POST /api/user/login': {
    code: 200,
    message: '登录成功',
    data: {
      token: 'mock_token_123456789',
      userInfo: {
        id: 1,
        name: '张三',
        nickname: '张三',
        phone: '138****8888',
        avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
        balance: 1288.50,
        points: 520,
        isMember: true,
        memberLevel: 'VIP',
        memberExpireDate: '2025-12-31'
      }
    }
  },

  // 用户登出
  'POST /api/user/logout': {
    code: 200,
    message: '登出成功',
    data: null
  },

  // 更新用户信息
  'PUT /api/user/info': {
    code: 200,
    message: '更新成功',
    data: {
      id: 1,
      name: '张三',
      phone: '138****8888',
      avatar: 'https://img.yzcdn.cn/vant/cat.jpeg'
    }
  },

  // 获取订单详情
  'GET /api/orders/:id': {
    code: 200,
    message: '成功',
    data: {
      id: 1,
      orderNo: 'JJ202501280001',
      status: 1,
      statusText: '待服务',
      serviceType: '深度清洁',
      serviceTime: '2025-01-28 14:00',
      address: '北京市朝阳区xxx小区xxx号楼xxx室',
      amount: 299.00,
      createTime: '2025-01-28 10:30',
      serviceDetails: [
        { name: '深度清洁服务', price: 299.00, quantity: 1 }
      ],
      couponDiscount: 0,
      actualAmount: 299.00,
      paymentStatus: 1,
      paymentTime: '2025-01-28 10:35'
    }
  },

  // 确认订单
  'PUT /api/orders/:id/confirm': {
    code: 200,
    message: '订单确认成功',
    data: null
  },

  // 订单评价
  'POST /api/orders/:id/rate': {
    code: 200,
    message: '评价成功',
    data: null
  },

  // 添加地址
  'POST /api/addresses': {
    code: 200,
    message: '地址添加成功',
    data: {
      id: 3,
      name: '王五',
      phone: '137****7777',
      province: '北京市',
      city: '北京市',
      district: '东城区',
      detail: 'xxx街道xxx号',
      isDefault: false
    }
  },

  // 更新地址
  'PUT /api/addresses/:id': {
    code: 200,
    message: '地址更新成功',
    data: null
  },

  // 删除地址
  'DELETE /api/addresses/:id': {
    code: 200,
    message: '地址删除成功',
    data: null
  },

  // 设置默认地址
  'PUT /api/addresses/:id/default': {
    code: 200,
    message: '默认地址设置成功',
    data: null
  },

  // 领取优惠券
  'POST /api/coupons/:id/receive': {
    code: 200,
    message: '优惠券领取成功',
    data: null
  },

  // 使用优惠券
  'POST /api/coupons/:id/use': {
    code: 200,
    message: '优惠券使用成功',
    data: null
  },

  // 标记消息为已读
  'PUT /api/notifications/:id/read': {
    code: 200,
    message: '标记成功',
    data: null
  },

  // 批量标记为已读
  'PUT /api/notifications/read-all': {
    code: 200,
    message: '全部标记成功',
    data: null
  },

  // 删除通知
  'DELETE /api/notifications/:id': {
    code: 200,
    message: '删除成功',
    data: null
  },

  // 创建支付订单
  'POST /api/payment/create': {
    code: 200,
    message: '支付订单创建成功',
    data: {
      paymentId: 'PAY202501280001',
      paymentUrl: 'https://pay.example.com/pay/PAY202501280001',
      qrCode: ''
    }
  },

  // 查询支付状态
  'GET /api/payment/:id/status': {
    code: 200,
    message: '成功',
    data: {
      paymentId: 'PAY202501280001',
      status: 'paid',
      statusText: '支付成功',
      paidTime: '2025-01-28 10:35'
    }
  },

  // 申请退款
  'POST /api/payment/refund': {
    code: 200,
    message: '退款申请提交成功',
    data: {
      refundId: 'REF202501280001',
      status: 'processing',
      statusText: '退款处理中'
    }
  },

  // 上传图片
  'POST /api/upload/image': {
    code: 200,
    message: '上传成功',
    data: {
      url: 'https://img.example.com/uploads/202501280001.jpg',
      filename: '202501280001.jpg',
      size: 1024000
    }
  },

  // 获取用户统计数据
  'GET /api/statistics/user': {
    code: 200,
    message: '成功',
    data: {
      totalOrders: 15,
      completedOrders: 12,
      totalAmount: 2980.00,
      savedAmount: 298.00,
      memberDays: 365,
      points: 520
    }
  },

  // 获取订单统计数据
  'GET /api/statistics/orders': {
    code: 200,
    message: '成功',
    data: {
      today: { count: 2, amount: 598.00 },
      thisWeek: { count: 8, amount: 1596.00 },
      thisMonth: { count: 15, amount: 2980.00 },
      statusDistribution: {
        pending: 3,
        processing: 2,
        completed: 10,
        cancelled: 0
      }
    }
  },

  // 获取系统配置
  'GET /api/config/system': {
    code: 200,
    message: '成功',
    data: {
      appName: '捷净洗护',
      version: '1.0.0',
      customerService: '400-123-4567',
      workingHours: '09:00-21:00',
      minOrderAmount: 50.00,
      deliveryFee: 10.00,
      freeDeliveryAmount: 200.00
    }
  },

  // 获取版本信息
  'GET /api/config/version': {
    code: 200,
    message: '成功',
    data: {
      currentVersion: '1.0.0',
      latestVersion: '1.0.1',
      hasUpdate: true,
      updateContent: '修复已知问题，优化用户体验',
      forceUpdate: false,
      downloadUrl: 'https://app.example.com/download/latest'
    }
  },

  // 模拟错误响应
  'GET /api/error/400': {
    code: 400,
    message: '请求参数错误'
  },

  'GET /api/error/401': {
    code: 1001,
    message: '用户未登录'
  },

  'GET /api/error/500': {
    code: 500,
    message: '服务器内部错误'
  }
}